package com.mvc.anocation.listener;

import java.util.Map;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import com.mvc.anocation.unti.StrutsAnocation;

public class ActionListener implements ServletContextListener {

	@Override
	public void contextDestroyed(ServletContextEvent event) {

	}

	@Override
	public void contextInitialized(ServletContextEvent event) {
		ServletContext context = event.getServletContext();
		String xmlPath = context.getInitParameter("struts-config");
		String tomPath = context.getRealPath("\\");
		Map<String, String> map = StrutsAnocation.struts_anocation(tomPath + xmlPath);
		context.setAttribute("s", map);
		System.out.println("记载完成！");
	}

}
